package com.cc.model.convert


import com.cc.model.Category
import com.cc.model.dto.CategoryDto
import org.mapstruct.*

@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE, componentModel = MappingConstants.ComponentModel.SPRING)
abstract class CategoryConvert {

    abstract fun toEntity(categoryDto: CategoryDto): Category

    abstract fun toDto(category: Category): CategoryDto

    @BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
    abstract fun partialUpdate(categoryDto: CategoryDto, @MappingTarget category: Category): Category
}